package com.mud.mudcommune.view.fragment.twoLevel;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.mud.mudcommune.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * A simple {@link Fragment} subclass.
 */
public class MessCenterFragment extends Fragment implements View.OnClickListener {
    private static MessCenterFragment fragment = new MessCenterFragment();
    @BindView(R.id.head_title)
    TextView title;
    @BindView(R.id.case_back)
    ImageView back;
    Unbinder unbinder;

    public MessCenterFragment() {
    }

    public static Fragment getInstance() {
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_mess_center, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        back.setOnClickListener(this);
        title.setText("信息中心");
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.case_back:
                getFragmentManager().popBackStack();
                break;
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
    }
}
